Skip to content

Conversation

@shaghayeghfar
Copy link

@shaghayeghfar shaghayeghfar commented Oct 28, 2025

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist:
completed the sprint-3 implement-and-rewrite by answering the questions in the tasks and
writing test cases and check to make sure all test-cases have passed.

@shaghayeghfar shaghayeghfar added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 28, 2025
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Why not include a brief description of the changes made in this PR in the "Changelist" section of this PR description?

Comment on lines 15 to 17
test("should return true for a negative proper fraction (numerator < denominator)", () => {
expect(isProperFraction(-4, 7)).toEqual(true);
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about negative improper fraction?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made some changes to the is-proper-fraction function , it works correctly now.
Thank you for your guides

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your function is correct.

I meant to point out that you introduced a test for "negative proper fraction", but there is no test for "negative improper fraction". Ideally, a comprehensive test should cover all possible scenarios.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dear Cj
thank you very much for your reviewing and for clarification .
I changed the test to :

test("should correctly handle all negative number scenarios", () => {
const cases = [
// Proper negatives (absolute numerator < absolute denominator)
[-4, 7, true, "-4/7 proper fraction"],
[4, -7, true, "4/-7 proper fraction"],
[-2, -5, true, "-2/-5 proper fraction"],

// Improper negatives (absolute numerator >= absolute denominator)
[-5, 2, false, "-5/2 improper fraction"],
[5, -2, false, "5/-2 improper fraction"],
[-7, -4, false, "-7/-4 improper fraction"],

// Edge equal case
[-3, -3, false, "-3/-3 equal fraction"],

];
for (const [num, den, expected, desc] of cases) {
expect(isProperFraction(num, den)).toBe(expected);
}
});

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Oct 28, 2025
@shaghayeghfar
Copy link
Author

@cjyuan

Dear Cj
Thank you for reviewing my code and for your helpful feedback.
I’ve made the changes you suggested and tests work properly now. thank you again!
I really appreciate your time and support .

@shaghayeghfar
Copy link
Author

@cjyuan
Dear Cj,

I hope you’re doing well! Sorry to bother you .
I know you’re busy, but if you have some time later, could you please review my changes and complete my PR status? I need to submit the module as soon as possible, and I can’t do so until the PRs are finalized.

Many thanks, and sorry for any inconvenience!

Best regards,

Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The PR description is missing a Changelist section. Can you restore the Changelist section and include a brief description of this PR in the section?

Note: Your forgot to change the label to "Needs review" after you completed the changes. Without the label, I would not know for certain if the PR is ready to be reviewed.

Comment on lines 15 to 17
test("should return true for a negative proper fraction (numerator < denominator)", () => {
expect(isProperFraction(-4, 7)).toEqual(true);
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your function is correct.

I meant to point out that you introduced a test for "negative proper fraction", but there is no test for "negative improper fraction". Ideally, a comprehensive test should cover all possible scenarios.

@shaghayeghfar shaghayeghfar added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Nov 4, 2025
@shaghayeghfar
Copy link
Author

Dear Cj

thank you so much for your clarification and your time.
I didn’t realize that I needed to change the label again, but thanks to your guidance I understand it now. I’ll make sure to do that for all my future PRs.

I really appreciate your help and support! 🙏

Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look great. Well done.

Comment on lines +48 to +50
// Edge equal case
[-3, -3, false, "-3/-3 equal fraction"],
];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also consider checking -3/3 and 3/-3.

Comment on lines +14 to +17
// // Case 3: Negative fraction
// test("should return true for a negative proper fraction (numerator < denominator)", () => {
// expect(isProperFraction(-4, 7)).toEqual(true);
// });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code submitted to a PR should be free of any unused code. Keeping code clean makes code easier to review.

Should you ever need this code in the future, you can recover or access the code from previous commits. Whenever we make a commit, Git "save a copy of the whole repository" when the commit was made.

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 4, 2025
@shaghayeghfar
Copy link
Author

Dear Cj
Thank you very much for your of your and feedbacks.
I really appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants